import {menulist} from "@/request/api.js"
export default {
    state:{
        menuList:[]
    },
    getters:{
        get_menuList(state){
            return state.menuList;
        }
    },
    mutations:{
        mutation_menuList(state,payload){
            state.menuList = payload;
        }
    },
    actions:{
        async action_menuList({commit}){
            try{
                let res = await menulist();
                if(res.code == 200){
                   commit("mutation_menuList",res.list)
                }
            }catch(err){
                console.log(err);
            }
        }
    },
    namespaced:true
}